package com.rgs.skywalking.demo.entity;

import lombok.Getter;

import java.io.Serializable;

/**
 * @program: rgs-study0project
 * @description:
 * @author: Mr.Ren
 * @create: 2024-08-31 23:21
 **/
@Getter
public class Result implements Serializable {

    private Integer code;

    private String message;

    private Object data;

    public Result() {

    }

    public Result(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static Result success(Object data){
        return new Result(200,"处理成功",data);
    }

    public static Result fail(Integer code, String message){
        return new Result(code,"处理失败",null);
    }

    public static Result fail( String message){
        return fail(1009,message);
    }
}
